import { getTeacherReturn,addTeacherReturn,delTeacherReturn,editTeahcerReturn,queryTeacherType  } from "./type"
//统一管理用户相关的接口

//引入封装好的axios
import request from "@/utils/request"
//引入登录成功后返回信息的类型
enum API{
   
    GETALLINFO_URL = "/teach/?",
    ADDTEACHER_URL = "/teach",
    DELTEACHER_URL = "/teach/?",
    EDITTEAHER_URL = "/teach",
    QUERYTEACHERINFO_URL = '/teach/pagingQueries/?'
}
export const getMember = (page:number,pageSize:number)=>{
    return request.get<any,getTeacherReturn>(API.GETALLINFO_URL+`page=${page}&pageSize=${pageSize}`)
}
export const addMember  = (data:any)=>{
    return request.post<any,addTeacherReturn>(API.ADDTEACHER_URL,data)
}
export const delMember = (data:any)=>{
    return request.delete<any,delTeacherReturn>(API.DELTEACHER_URL+`id=${data}`)
}
export const editMember = (data:any)=>{
    return request.patch<any,editTeahcerReturn>(API.EDITTEAHER_URL,data)
}
export const queryMember = (data:any)=>{
    
    return request.get<any,queryTeacherType>(API.QUERYTEACHERINFO_URL+`id=${data}`)
}